IntEEPROM
 
 
 Bean IntEEPROM
 
Internal EEPROM

Typical usage of the bean in user's code.

Typical Usage:

Required bean name is "IEE1".
There are the following two typical usage modes:

(1)
The easiest usage of the bean is a single byte read from and write to EEPROM.

 MAIN.C

byte Data;

void main(void)
{

  /* Write number 28 to address 0x600 */
  IEE1_SetByte(0x0600,28);
  /* Read contents of EEPROM array at address 0x600 and write it to Data variable */
  IEE1_GetByte(0x0600,&Data);

}
Note: Address of EEPROM is meant as an absolute address, not an index in EEPROM array.

(2)
When property 'Page size' is set up to different number than 0, methods using virtual page are available. The following example reads data content of some EEPROM area, modifies it, and stores it to another location in EEPROM.

 MAIN.C


void main(void)
{
  
  /* Fill virtual page with actual data content on address 0x600 */
  IEE1_GetPage(0x0600);
  /* Write number 23 to first cell of page */
  IEE1_SetActBytePage(23);
/* Write number 0 to second cell */
  IEE1_SetActBytePage(0);
  /* Write number 255 to tenth cell */
  IEE1_SetBytePage(9,0xff);
  /* Rest of page fill with ff */
  while( IEE1_SetActBytePage(0xff)==ERR_OK );
  /* Store data content of virtual page to EEPROM on address 0x0630 */
  IEE1_SetPage(0x0630);

}
Note: Method SetBytePage/GetBytePage use index 0 to PageSize-1

For more about typical usage of the bean code please refer to the page Bean Code Typical Usage.


Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.